/**
 * Created in 2012-3-5.
 */
package com.surekam.mnai.service.extractor.parser;

/**
 * 特定于站点www.096.me的查询结果的解析器。
 * 
 * @author 吴政
 * 
 */
public class ZeroNineSixSiteParser extends XmlParser {

	/**
	 * 创建一个特定于站点www.096.me的查询结果的解析器。
	 */
	public ZeroNineSixSiteParser() {
		setMobileNumberSegmentNodeXPath("/smartresult/product/phonenum");
		setPhoneCardTypeNodeXPath("/smartresult/product/location");
		setProvinceNodeXPath("/smartresult/product/location");
		setCityNodeXPath("/smartresult/product/location");
	}

	@Override
	protected String getPhoneCardType() {
		String phoneCardType = super.getPhoneCardType();

		int beginIndex = 0;
		if (phoneCardType.contains("移动")) {
			beginIndex = phoneCardType.indexOf("移动");
		} else if (phoneCardType.contains("联通")) {
			beginIndex = phoneCardType.indexOf("联通");
		} else if (phoneCardType.contains("电信")) {
			beginIndex = phoneCardType.indexOf("电信");
		}

		return phoneCardType.substring(beginIndex);
	}

	@Override
	protected String getProvince() {
		return null;
	}

	@Override
	protected String getCity() {
		return null;
	}

}
